<template>
  <div>
    <!-- 现金奖励 -->
    <div class="reward_box money">
      <div class="reward_type_box flex align-center">
        <img class="reward_type"
             src="@/assets/img/money_1.png"
             alt="现金奖励">
        <div class="reward_tip">
          <span>72小时内完成</span>
        </div>
      </div>

      <div class="px-102px">
        <!-- <div class="list flex justify-between"> -->
        <div class="wapper">
          <div class="list noRem">
            <img v-for="(item,index) in monyReward"
                 :src="item.img"
                 :key="index">
          </div>
          <div class="line"
               :style="{width:(monyReward.length-1)*107.5+'px'}">
            <span class="round"
                  v-for="(item,index) in (monyReward.length-2)"
                  :key="index"
                  :style="{left:1 / (monyReward.length - 1) * 100 * (index + 1) + '%'}"></span>
          </div>

          <div class="label flex justify-between "
               :style="{width:(monyReward.length-1)*107.5+35+'px'}">
            <p v-for="(item,index) in monyReward"
               :key="index">
              {{item.num}}个祝福
            </p>
          </div>
        </div>
      </div>

    </div>
    <!-- 冲榜奖励 -->
    <div class="reward_box kind">
      <div class="reward_type_box flex align-center">
        <img class="reward_type"
             src="@/assets/img/money_2.png"
             alt="现金奖励">
        <div @click="handleGoToPrizeList"
             class="reward_tip flex align-center">
          <span>奖品清单</span>
          <img class="more"
               src="@/assets/img/prize_list_arrow.png"
               alt="更多">
        </div>
      </div>

      <div v-if="kindReward.length"
           class="list  ">
        <div class="item "
             v-for="(item,index) in kindReward"
             :key="index">
          <div class="img-box">
            <img v-for="(img, idx) in item.img"
                 :key="idx"
                 :src="img"
                 alt="奖品">
          </div>
          <p class="num">{{item.ranking}}</p>
          <p class="name">{{item.name}}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    kindReward: {
      default: () => [],
      type: Array
    },
    monyReward: {
      default: () => [],
      type: Array
    }
  },
  methods: {
    handleGoToPrizeList() {
      this.$emit('handleGoToPrizeList')
    }
  }
}
</script>

<style lang="scss" >
.reward_box {
  position: relative;
  background-color: #ffffff;
  // height: 244px;
  border-radius: 10px;
  border: 1px solid #000000;
  .reward_type_box {
    background-image: url("~@/assets/img/mine_2.png");
    background-size: 100% 100%;
    width: 445px;
    height: 58px;
    margin-top: -29px;
    .reward_type {
      width: 148px;
      margin-left: 30px;
    }
    .reward_tip {
      font-size: 26px;
      font-weight: 800;
      color: #492105;
      margin-left: 44px;
    }
  }
  // 现金奖励
  &.money {
    margin-bottom: 61px;
    .px-102px {
      padding: 0 102px;
    }
    .wapper {
      overflow-x: auto;
      position: relative;
    }
    .list {
      margin-top: 52px;
      white-space: nowrap;
      &.noRem {
        &:last-child > img {
          margin-right: 0;
        }
        & > img {
          width: 35px;
          height: 45px;
          margin-right: 72.5px;
          display: inline-block;
          &:last-child {
            margin-right: 0;
          }
        }
      }

      // &:last-child > img {
      //   margin-right: 0;
      // }
      // & > img {
      //   width: 70px;
      //   height: 90px;
      //   margin-right: 100px;
      //   display: inline-block;
      //   &:last-child {
      //     margin-right: 0;
      //   }
      // }
    }
    .line {
      // width: calc(100% - 204px - 70px);
      height: 12px;
      border: 1px solid #ffd39c;
      background-color: #ffebd2;
      margin-top: 11px;
      margin-left: 35px;
      position: relative;
      &::after,
      &::before,
      .round {
        width: 17px;
        height: 17px;
        background: #fe920d;
        border-radius: 50%;
        content: "";
        position: absolute;
        right: -8.5px;
        top: -2.5px;
      }
      &::after {
        left: -8.5px;
      }
      .round {
        margin-left: -8.5px;
      }
    }
    .label {
      font-size: 20px;
      font-weight: 400;
      color: rgba(87, 16, 13, 0.65);
      margin-top: 12px;
      margin-bottom: 20px;
      line-height: 30px;
      // span,
      // p.noRem {
      // width: 72.5px;
      // margin-right: 35px;
      // &:last-child {
      //   margin-right: 0;
      // }
      // }
    }
  }
  // 冲榜奖励
  &.kind {
    margin-bottom: 32px;
    .more {
      width: 30px;
      height: 30px;
      margin-left: 10px;
    }
    .list {
      padding: 0 46px;
      margin-top: 63px;
      width: 100%;
      overflow-x: auto;
      white-space: nowrap;
      .item {
        display: inline-block;
        margin-right: 100px;
        &:last-child {
          margin-right: 0;
        }
        .img-box {
          img {
            height: 116px;
            display: block;
            margin: 0 auto;
          }
        }
        .num {
          font-size: 24px;
          font-family: SourceHanSansCN-Medium, SourceHanSansCN;
          font-weight: 700;
          color: #57100d;
          text-align: center;
          margin-top: 20px;
          margin-bottom: 6px;
        }
        .name {
          font-size: 24px;
          font-family: SourceHanSansCN-Regular, SourceHanSansCN;
          font-weight: 400;
          color: rgba(87, 16, 13, 0.65);
          text-align: center;
          padding-bottom: 20px;
        }
      }
    }
  }
}
</style>